

#ifndef _GMSHPROCESS_H__
#define _GMSHPROCESS_H__
#include <QProcess>
#include <QDialog>
#include <QDebug>
#include <iostream>
#include <QHBoxLayout>
#include <QPlainTextEdit>

#include "GmshAPI.hpp"
#include "GmshWidget.hpp"

NAMESPACE_BEGIN(NSGmshProcess)

class MESHAPI GmshProcess : public QObject{
    Q_OBJECT

public:

    GmshProcess(QObject* parent);
    ~GmshProcess();

    void startProcess(const QString& program, const QStringList& arguments);


signals:
    void meshProcessFinishedSignal();


private Q_SLOTS:
    void readAllStdOutput();
    void readAllStdError();
    void processStateChanged(QProcess::ProcessState state);
    void processErrorOccurred(QProcess::ProcessError error);
    void terminateProcessEvent();

private:
    QProcess* process;
    QDialog* mesh_dialog;
    QPlainTextEdit* log_text;

};

NAMESPACE_END

#endif  //_GMSHPROCESS_H__